//
//  NSAttributedString+Size.m
//  KaiChat
//
//  Created by lx on 2023/11/21.
//

#import "NSAttributedString+Size.h"

@implementation NSAttributedString (Size)

- (CGSize)getStringSizeWithWidth:(CGFloat)width font:(UIFont *)font {
    CGRect boundingRect = [self boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX) options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading context:nil];
    return boundingRect.size;
}

@end
